package org.chengn.level_easy.context2744;

import java.util.HashSet;
import java.util.Set;

/**
 * @Title: Context2744
 * @Author ChengN
 * @Package org.chengn.level_easy.context2744
 * @Date 2024/1/17 1:14
 * @description: 最大字符串配对数目
 */
public class Context2744 {
    public int maximumNumberOfStringPairs(String[] words) {
        Set<String> set = new HashSet<>();
        int res = 0;
        for (String word : words) {
            if (set.contains(new StringBuffer(word).reverse().toString())) res++;
            else set.add(word);

        }
        return res;
    }
}
